import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import junit.framework.TestCase;


public class RecipeTest extends TestCase{
	public CoffeeMaker cm;
	public Inventory i;
	public Recipe r2;
	public Recipe r4;
	public java.lang.String name;
	
	@Before
	public void setUp() throws Exception {
		cm = new CoffeeMaker();
		i = cm.checkInventory();

		r2 = new Recipe();
		r2.setName("Coffee");
		r2.setPrice(50);
		r2.setAmtCoffee(2);
		r2.setAmtMilk(2);
		r2.setAmtSugar(2);
		r2.setAmtChocolate(-1);
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testSetAmtChocolate1() {
		r2.setAmtChocolate(1);
		assertEquals(1,r2.getAmtChocolate(),0);
	}
	
	
	@Test
	public void testSetAmtChocolate2() {
		r2.setAmtChocolate(-1);
		assertEquals(0,r2.getAmtChocolate(),0);
	}
	
	@Test
	public void testSetAmtChocolate3() {
		r2.setAmtChocolate(0);
		assertEquals(0,r2.getAmtChocolate(),0);
	}
	
	@Test
	public void testSetAmtCoffee1() {
		r2.setAmtCoffee(1);
		assertEquals(1,r2.getAmtCoffee(),0);
	}
	
	
	@Test
	public void testSetAmtCoffee2() {
		r2.setAmtCoffee(-1);
		assertEquals(0,r2.getAmtCoffee(),0);
	}
	
	@Test
	public void testSetAmtCoffee3() {
		r2.setAmtCoffee(0);
		assertEquals(0,r2.getAmtCoffee(),0);
	}
	
	@Test
	public void testSetAmtMilk1() {
		r2.setAmtMilk(1);
		assertEquals(1,r2.getAmtMilk(),0);
	}
	
	
	@Test
	public void testSetAmtMilk2() {
		r2.setAmtMilk(-1);
		assertEquals(0,r2.getAmtMilk(),0);
	}
	
	@Test
	public void testSetAmtMilk3() {
		r2.setAmtMilk(0);
		assertEquals(0,r2.getAmtMilk(),0);
	}
	
	
	@Test
	public void testSetAmtSugar1() {
		r2.setAmtSugar(1);
		assertEquals(1,r2.getAmtSugar(),0);
	}
	
	
	@Test
	public void testSetAmtSugar2() {
		r2.setAmtSugar(-1);
		assertEquals(0,r2.getAmtSugar(),0);
	}
	
	@Test
	public void testSetAmtSugar3() {
		r2.setAmtMilk(0);
		assertEquals(0,r2.getAmtMilk(),0);
	}
	
	@Test
	public void testSetPrice1() {
		r2.setPrice(10);
		assertEquals(10,r2.getPrice(),0);
	}
	
	@Test
	public void testSetPrice2() {
		r2.setPrice(-1);
		assertEquals(0,r2.getPrice(),0);
	}
	
	@Test
	public void testEquals1() {
		r2.setName(null);
		assertFalse(r2.equals(r2));
	}
	
	@Test
	public void testEquals2() {
		r2.setName("test");
		assertTrue(r2.equals(r2));
	}

}
